# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=hivex
pkgver=1.3.21
pkgrel=0
pkgdesc="System for extracting the contents of Windows Registry"
url="https://libguestfs.org/"
arch="all"
license="LGPL-2.1"
makedepends="libxml2-dev readline-dev perl-dev"
checkdepends="bash"
subpackages="$pkgname-dev $pkgname-doc"
source="https://libguestfs.org/download/hivex/hivex-$pkgver.tar.gz
	disable-test-gnuopt-posix.patch"

# secfixes:
#   1.3.19-r2:
#     - CVE-2021-3504

build() {
	./configure \
		--bindir=/usr/bin \
		--libdir=/usr/lib \
		--prefix=/usr \
		--disable-rpath \
		--disable-perl \
		--disable-ruby \
		--disable-ocaml \
		--disable-python \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
e893d9fa77655540d29ef6657764f701f9cddb33d11b2bfef36ce0c2caebab92b55a32b7e1c99efbab0d53f558a44bf1c4c6f6da13daa37d568ff96d7d28f842  hivex-1.3.21.tar.gz
5f84b0a33b4ebe30db597b3f1addbf53289cd75d5f636151af5e2782acc6bdc288bad51381e907d91eaa7542deb9de197dc1bbb5b6c6b9e1612bf3bbfacc9eb5  disable-test-gnuopt-posix.patch
"
